#include<string>
using namespace std;

class Solution {
public:
    bool canConstruct(string s, int k) {
        int nums[26];
        memset(nums, 0, sizeof(nums));
        for (int i = 0; i < s.length(); ++i) {
            nums[s[i] - 'a']++;
        }
        int p = 0;
        for (int i = 0; i < 26; ++i) {
            if (nums[i] % 2) ++p;
        }
        if (p == 0) p = 1;
        return k >= p && k <= s.length();
    }
};